package com.atguigu.stgy.app.service.impl;

import com.atguigu.stgy.app.mapper.BrowsingHistoryMapper;
import com.atguigu.stgy.app.service.BrowsingHistoryService;
import com.atguigu.stgy.model.entity.BrowsingHistory;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
public class BrowsingHistoryServiceImpl extends ServiceImpl<BrowsingHistoryMapper , BrowsingHistory> implements BrowsingHistoryService {
    @Async
    @Override
    public void saveAsync(BrowsingHistory browsingHistory) {
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        this.save(browsingHistory);
    }
}
